<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="application/javascript" src="scripts/darts_board.js"></script>
<script type="application/javascript" src="scripts/darts_killer.js"></script>
<link rel="stylesheet" href="scripts/jquery.mobile-1.0.min.css" />
<style>
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
height: 100%;
}
.landscape, .landscape .ui-page, .portrait, .portrait .ui-page {
min-height: 100%;
}
</style>
<script type="text/javascript" src="scripts/jquery.min.js"></script>
<script type="text/javascript" src="scripts/jquery.mobile-1.0.min.js"></script>
</head>

<body bgcolor="000">
<!-- Start of first page -->
<div data-role="page" id="dartsboard" style="background-color:#1E1E1E;">

	<div data-role="header" data-position="inline" data-backbtn="false" class="header">
	<div class="ui-btn-left">
<a href="#" data-role="button" id="new_game" onclick="start_new_game(game_number++,randomfunction);refillPlayers('#select-choice-10');" >Start new game</a>
<a href="#" data-role="button" id="choose_sectors" onclick="chooseSectors();">Choose sectors</a>

</div>
<h1>Darts Vader</h1>
	<a href="#" data-role="button" id="killer_undo" onclick="undo();" class="ui-btn-right">Undo</a>
	</div><!-- /header -->

<div data-role="content" style="background-color:#1E1E1E;padding:0;">	

	 
<div id="dartsboardcanvas" style="height:100%; width:100%;vertical-align:top; position:relative;margin:0;">

 <div id="boards" class="ui-field-contain ui-body ui-br" data-role="fieldcontain" style="vertical-align:top;float:left; position:relative; width:100%;height:100%;margin:0;">


		<select name="select-choice-10" id="select-choice-10" multiple="multiple" data-native-menu="false"  onchange="refillPlayers(this);">
			<option>Choose players</option>
		</select>
	<div id="killercanvas" style="height:100%;width:100%;vertical-align:top; position:relative;float:left;"> </div>	
</div>
</div>	

</div><!-- /content -->
<div class='footer' data-role='footer'> 
      </div> 
</div><!-- /page -->

<script>
//$(document).ready(function(){
//	$('#boards').height(sizeWindowHeight);
	//$("#darts_board").width(sizedWindowWidth);
	//$("#darts_board").height(sizedWindowWidth);
	//start_new_game(game_number,randomize_player_nums2);
//});
$(window).bind("orientationchange resize pageshow",function () {
	sizedWindowWidth = $(window).width();
	sizeWindowHeight = $(window).height();
    header = $(".header:visible");
    content = $(".content:visible");
	content_height = sizeWindowHeight - header.outerHeight()-5;
	var boardSize = content_height;

	$('#boards').width(sizedWindowWidth-boardSize-5);
	$('#killercanvas').width(sizedWindowWidth-boardSize-5);

	darts_board_init(parseInt(boardSize),parseInt(boardSize), parseInt(boardSize/2),parseInt(boardSize/2), parseInt(boardSize/2-boardSize/15),'#dartsboardcanvas');
	killer_board_init(parseInt(sizedWindowWidth/5),boardSize/*sizeWindowHeight*5/6*/,'#killercanvas');

	killer_draw_state();
});
	sizedWindowWidth = $(window).width();
	sizeWindowHeight = $(window).height();
    header = $(".header:visible");
    content = $(".content:visible");
	content_height = sizeWindowHeight - header.outerHeight()-5;
	var boardSize = content_height;

	$('#boards').width(sizedWindowWidth-boardSize-5);
	$('#killercanvas').width(sizedWindowWidth-boardSize-5);

	darts_board_init(parseInt(boardSize),parseInt(boardSize), parseInt(boardSize/2),parseInt(boardSize/2), parseInt(boardSize/2-boardSize/15),'#dartsboardcanvas');
//	killer_board_init(parseInt(sizedWindowWidth/5),boardSize/*sizeWindowHeight*5/6*/,'#killercanvas');
//	killer_game_init();
	players_max_count = 20;
	lifes_init_count = 10;
	
	player_names = new Array("Kos F","Kos R","Sasha","Vasya","Roma","Igor","Denis V","Денис М.","Vova","Lisa", "Lena" ,"Kolya", "Vlad", "Lyoha", "George", "Lara", "Tanya", "Janet", "Marc", "Andrey");
	darts_hook = "killer_hook";
	blind_rounds_count = 0;// init state
	killer_board_init(parseInt(sizedWindowWidth/5),boardSize/*sizeWindowHeight*5/6*/,'#killercanvas');
    killer_game_init();
	initPlayers('#select-choice-10');
	blink_curent_player();
	var game_number=1;
	var randomfunction =  randomize_player_nums_choosen;
	var gamestarted = false;


</script>
</body>

</html>
